#include <stdio.h>

int main(void)
{
    int t_ct;
    long double time, power_of_2;
    int limit;

    printf("Enter the number of terms you want: ");
    scanf("%d", &limit);

    for (time = 0, t_ct =0, power_of_2=1; t_ct < limit; power_of_2*= 2.0, t_ct++) {
        time += 1.0/power_of_2;
        printf("time=%.40Le when terms = %d\n", time, t_ct+1);
    }

    return 0;
}
